export default {
	namespaced: true,
    state: {
		userId: null,
        username: null,		//用户名
		password: null,		//用户密码
		expiration: null,		//token 有效期
		token: null,		//token
		valid: null,		//截至有效时间
    },
    getters: {

    },
    mutations: {
		setUserInfo(state, info){
			state.userId = info.userId || 0
			state.username = info.username
			state.password = info.password
			state.expiration = info.expiration
			state.token = info.token
			state.valid = info.valid || new Date().getTime() + info.expiration*1000
		}
    },
    actions: { 
		setUserInfo(context, info){
			context.commit('setUserInfo', info)
		}
    }
}